#include "X509Certificate.h"
#include "KeyGenerator.h"

namespace kryptos { namespace cryptography {

X509Certificate::X509Certificate()
{
}

X509Certificate::X509Certificate(const PrivateKey &privateKey)
{
    m_privateKey = privateKey;
}

X509Certificate::~X509Certificate()
{
}

std::string X509Certificate::string()
{
    return KeyGenerator::certificateFromKey(m_privateKey);
}

std::string X509Certificate::label()
{
    return "";
}

std::string X509Certificate::userName()
{
    return m_privateKey.info().name();;
}

std::string X509Certificate::userEmail()
{
    return m_privateKey.info().email();
}

PublicKey X509Certificate::publicKey()
{
    return m_privateKey.publicKeyPart();
}

}}
